package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SigninRuleMapper;
import com.ruoyi.system.domain.SigninRule;
import com.ruoyi.system.service.ISigninRuleService;

/**
 * 签到规则Service业务层处理
 * 
 * @author hyb
 * @date 2023-02-13
 */
@Service
public class SigninRuleServiceImpl implements ISigninRuleService 
{
    @Autowired
    private SigninRuleMapper signinRuleMapper;

    /**
     * 查询签到规则
     * 
     * @param id 签到规则主键
     * @return 签到规则
     */
    @Override
    public SigninRule selectSigninRuleById(Long id)
    {
        return signinRuleMapper.selectSigninRuleById(id);
    }

    /**
     * 查询签到规则列表
     * 
     * @param signinRule 签到规则
     * @return 签到规则
     */
    @Override
    public List<SigninRule> selectSigninRuleList(SigninRule signinRule)
    {
        return signinRuleMapper.selectSigninRuleList(signinRule);
    }

    /**
     * 新增签到规则
     * 
     * @param signinRule 签到规则
     * @return 结果
     */
    @Override
    public int insertSigninRule(SigninRule signinRule)
    {
        signinRule.setCreateTime(DateUtils.getNowDate());
        return signinRuleMapper.insertSigninRule(signinRule);
    }

    /**
     * 修改签到规则
     * 
     * @param signinRule 签到规则
     * @return 结果
     */
    @Override
    public int updateSigninRule(SigninRule signinRule)
    {
        signinRule.setUpdateTime(DateUtils.getNowDate());
        return signinRuleMapper.updateSigninRule(signinRule);
    }

    /**
     * 批量删除签到规则
     * 
     * @param ids 需要删除的签到规则主键
     * @return 结果
     */
    @Override
    public int deleteSigninRuleByIds(Long[] ids)
    {
        return signinRuleMapper.deleteSigninRuleByIds(ids);
    }

    /**
     * 删除签到规则信息
     * 
     * @param id 签到规则主键
     * @return 结果
     */
    @Override
    public int deleteSigninRuleById(Long id)
    {
        return signinRuleMapper.deleteSigninRuleById(id);
    }
}
